package com.flyduck.modules.schedule.task;

import com.flyduck.modules.schedule.mapper.SysScheduleJobLogMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: flyduck-admin
 * @description: 清理定时任务日志
 * @author: flyduck
 * @create: 2020-06-17 14:02
 **/
@Component("clearScheduleLogTask")
@Slf4j
public class ClearScheduleLogTask implements ITask {

    @Autowired
    private SysScheduleJobLogMapper sysScheduleJobLogMapper;

    @Override
    public void run(String params) {
        log.info("开始清理定时任务日志");
        //清理定时任务日志
        sysScheduleJobLogMapper.deleteAll();
        log.info("清理定时任务日志成功");

    }
}
